home *** CD-ROM | disk | FTP | other *** search
/ Nautilus 1992 July / Nautilus-3-8 / Nautilus-3-8.bin / Tools & Utilities / Techy Stuff / Source ƒ / Dragonsmith 1.0b2 / Dragon.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-05-19  |  2.5 KB  |  82 lines

  1. /*
  2.     Dragon.h
  3.     
  4.     Interface to Dragon.c
  5. */
  6.  
  7. #include    "HandleUtils.h"
  8. #ifdef DEBUG
  9.     #include    "FileUtils.h"
  10. #endif
  11.  
  12. class Dragon: indirect {
  13.  
  14.     protected:
  15.         RgnHandle    cursorRgn;        // For WaitNextEvent
  16.         Boolean        running;            // Are we or are we not running?
  17.         Boolean        autoQuit;            // Should we quit when double-clicked, or stick around?
  18.         Boolean        menusInstalled;    // Do we have working menus?
  19.         
  20.     public:
  21.                     Dragon (void);        // Constructor
  22.         virtual void    Start (void);
  23.         virtual void    Run (void);
  24.         virtual OSErr    DoOapp (AppleEvent *theAppleEvent, AppleEvent *theReply, long refCon);
  25.         virtual OSErr    DoOdoc (AppleEvent *theAppleEvent, AppleEvent *theReply, long refCon);
  26.         virtual OSErr    ProcessDroppings (FSSpec **docs, long numDocs);
  27.         virtual void    StopRunning (void);
  28.         virtual void    Finish (void);
  29.  
  30. #ifdef DEBUG
  31.         void            Test (void);
  32. #endif
  33.         
  34.     protected:
  35.         virtual void    DoEvent (EventRecord *event);
  36.         virtual void    DoMouseDown (EventRecord *theEvent);
  37.         virtual void    DoMouseUp (EventRecord *theEvent);
  38.         virtual void    DoKeyDown (EventRecord *theEvent);
  39.         virtual void    DoActivate (EventRecord *theEvent);
  40.         virtual void    DoUpdateEvent (EventRecord *theEvent);
  41.         virtual void    DoDiskInsert (EventRecord *theEvent);
  42.         virtual void    DoOSEvent (EventRecord *theEvent);
  43.         virtual void    DoHighLevelEvent (EventRecord *theEvent);
  44.         virtual void    DoMenu (long menuItemCode);
  45.         virtual void    DoIdle (void);
  46.         virtual void    DoSuspend (void);
  47.         virtual void    DoResume (void);
  48.         virtual void    InitMac (void);
  49.         virtual void    InitMilieu (void);
  50.         virtual void    InitMem (void);
  51.         virtual void    SetUpMenus (void);
  52.         virtual void    CallMoreMasters (void);
  53.         virtual void    InitAppleEvents (void);
  54.         virtual void    Abort (short errNum);
  55.         virtual void    Error (short errNum);
  56. };
  57.  
  58. extern Dragon        *gDragon;
  59.  
  60. // ----------------        Error codes            ----------------
  61.  
  62.     enum {
  63.         eNothingWrong = 1000,
  64.         eNoAppleEvents = 1001,
  65.         eCouldntInstallAppleEvents = 1002,
  66.         eDebugNothingWrong = 2000
  67.     };
  68.  
  69. // ----------------        Resource constants    ----------------
  70.  
  71.     #define    rErrorAlert    129
  72.  
  73. // ----------------        Function prototypes    ----------------
  74.  
  75.     void main (void);
  76.     pascal OSErr HandleOapp (AppleEvent *theAppleEvent, AppleEvent *theReply, long refCon);
  77.     pascal OSErr HandleOdoc (AppleEvent *theAppleEvent, AppleEvent *theReply, long refCon);
  78.     pascal OSErr HandlePdoc (AppleEvent *theAppleEvent, AppleEvent *theReply, long refCon);
  79.     pascal OSErr HandleQuit (AppleEvent *theAppleEvent, AppleEvent *theReply, long refCon);
  80.     OSErr GotRequiredParams (AppleEvent *theEvent);
  81.     Dragon *CreateGDragon (void);
  82.